#!/usr/bin/env bash
# 控制并发数为5

all_num=5
thread_num=5

date

seq 1 ${all_num} | xargs -n 1 -I {} -P ${thread_num} sh -c \
"sleep 2;\
echo 'sleep 1'"

wait
date